﻿using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;

namespace nspEmail.Lables
{
    /// <summary>
    /// EmailSQLDAL 的摘要说明
    /// </summary>
    public class EmailSQLDAL
    {
        public EmailSQLDAL()
        {
            //
            // TODO: 在此处添加构造函数逻辑
            //
        }
        /// <summary>
        ///  调用查询资讯列表
        /// </summary>
        /// <param name="strSelect">SQL语句</param>
        /// <returns></returns>
        public static DataTable GetDataTable(string strSql)
        {
            return SqlOperate.SqlHelper.ExecuteTable(strSql);
        }


        /// <summary>
        ///  调用查询资讯列表
        /// </summary>
        /// <param name="strSelect">查询的内容</param>
        /// <param name="strWhere">查询条件</param>
        /// <param name="strTableName">查询的表、视图、存储过程</param>
        /// <returns></returns>
        public static DataTable GetDataTable(string strSelect, string strWhere, string strTableName, string strOrder)
        {
            SqlParameter[] param = new SqlParameter[] 
            {  
                    new SqlParameter("@StrSelect",strSelect),
                    new SqlParameter("@strWhere",strWhere),
                    new SqlParameter("@strTableName", strTableName), 
                    new SqlParameter("@strOrder", strOrder)
            };
            return SqlOperate.SqlHelper.ExecuteTable(CommandType.StoredProcedure, "SP_SelectByWhere", param);
        }

    }
}